package cn.zaichi.edu.excelcommon.entity;


import java.util.UUID;

import cn.zaichi.edu.excelcommon.constants.ImportType;
import cn.zaichi.edu.excelcommon.exception.ExcelException;
import org.apache.commons.lang3.StringUtils;


/**
 * excel导入参数
 */
public class BaseImportParam {
    private String uuid;
    /**
     * 接收导入数据类型 默认 使用 bean
     */
    private int importType=ImportType.typeBean;
    /**
     * 表头起始行下标默认0
     */
    private int titleStarRow=0;
    /**
     * 表头结束行下标默认0
     */
    private int titleEndRow=0;

    /**
     * 数据起始行 默认1
     */
    private int startRow=1;
    /**
     * 起始列 默认 0
     */
    private int startColumn=0;
    /**
     * 文件地址
     */
    private String filePath;

    /**
     * 文件密码
     */
    private String filePass;

    //对应 实体类
    Class<?> clz;


    public BaseImportParam(String filePath,Class<?> clz,String filePass) {
        if(StringUtils.isBlank(filePath)){
            throw new ExcelException("文件地址不能为空",-2);
        }
        this.filePath=filePath;
        this.clz=clz;
        this.filePass=filePass;
        this.uuid=UUID.randomUUID().toString();
    }

    public BaseImportParam(String filePath,Class<?> clz) {
        if(StringUtils.isBlank(filePath)){
            throw new ExcelException("文件地址不能为空",-2);
        }
        this.filePath=filePath;
        this.clz=clz;
        this.uuid=UUID.randomUUID().toString();
    }



    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public int getImportType() {
        return importType;
    }

    public void setImportType(int importType) {
        this.importType = importType;
    }

    public int getTitleStarRow() {
        return titleStarRow;
    }

    public void setTitleStarRow(int titleStarRow) {
        this.titleStarRow = titleStarRow;
    }

    public int getTitleEndRow() {
        return titleEndRow;
    }

    public void setTitleEndRow(int titleEndRow) {
        this.titleEndRow = titleEndRow;
    }

    public int getStartRow() {
        return startRow;
    }

    public void setStartRow(int startRow) {
        this.startRow = startRow;
    }

    public int getStartColumn() {
        return startColumn;
    }

    public void setStartColumn(int startColumn) {
        this.startColumn = startColumn;
    }
    public String getFilePath() {
        return filePath;
    }
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }
    public Class<?> getClz() {
        return clz;
    }
    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public String getFilePass() {
        return filePass;
    }

    public void setFilePass(String filePass) {
        this.filePass = filePass;
    }
}
